package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysHouseDecorationMomentMapper;
import com.ruoyi.project.system.domain.SysHouseDecorationMoment;
import com.ruoyi.project.system.service.ISysHouseDecorationMomentService;

/**
 * 整屋装修视频Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-26
 */
@Service
public class SysHouseDecorationMomentServiceImpl implements ISysHouseDecorationMomentService 
{
    @Autowired
    private SysHouseDecorationMomentMapper sysHouseDecorationMomentMapper;

    /**
     * 查询整屋装修视频
     * 
     * @param houseDecorationMomentId 整屋装修视频ID
     * @return 整屋装修视频
     */
    @Override
    public SysHouseDecorationMoment selectSysHouseDecorationMomentById(Long houseDecorationMomentId)
    {
        return sysHouseDecorationMomentMapper.selectSysHouseDecorationMomentById(houseDecorationMomentId);
    }

    /**
     * 查询整屋装修视频列表
     * 
     * @param sysHouseDecorationMoment 整屋装修视频
     * @return 整屋装修视频
     */
    @Override
    public List<SysHouseDecorationMoment> selectSysHouseDecorationMomentList(SysHouseDecorationMoment sysHouseDecorationMoment)
    {
        return sysHouseDecorationMomentMapper.selectSysHouseDecorationMomentList(sysHouseDecorationMoment);
    }

    /**
     * 新增整屋装修视频
     * 
     * @param sysHouseDecorationMoment 整屋装修视频
     * @return 结果
     */
    @Override
    public int insertSysHouseDecorationMoment(SysHouseDecorationMoment sysHouseDecorationMoment)
    {
        sysHouseDecorationMoment.setCreateTime(DateUtils.getNowDate());
        return sysHouseDecorationMomentMapper.insertSysHouseDecorationMoment(sysHouseDecorationMoment);
    }

    /**
     * 修改整屋装修视频
     * 
     * @param sysHouseDecorationMoment 整屋装修视频
     * @return 结果
     */
    @Override
    public int updateSysHouseDecorationMoment(SysHouseDecorationMoment sysHouseDecorationMoment)
    {
        return sysHouseDecorationMomentMapper.updateSysHouseDecorationMoment(sysHouseDecorationMoment);
    }

    /**
     * 批量删除整屋装修视频
     * 
     * @param houseDecorationMomentIds 需要删除的整屋装修视频ID
     * @return 结果
     */
    @Override
    public int deleteSysHouseDecorationMomentByIds(Long[] houseDecorationMomentIds)
    {
        return sysHouseDecorationMomentMapper.deleteSysHouseDecorationMomentByIds(houseDecorationMomentIds);
    }

    /**
     * 删除整屋装修视频信息
     * 
     * @param houseDecorationMomentId 整屋装修视频ID
     * @return 结果
     */
    @Override
    public int deleteSysHouseDecorationMomentById(Long houseDecorationMomentId)
    {
        return sysHouseDecorationMomentMapper.deleteSysHouseDecorationMomentById(houseDecorationMomentId);
    }

    @Override
    public int deleteSysHouseDecorationMomentByDecorationId(Long decorationId) {
        return sysHouseDecorationMomentMapper.deleteSysHouseDecorationMomentByDecorationId(decorationId);
    }
}
